#ifndef pacheth
#define packeth

#include "led.h"

#define CMD_REPORT_ID 1
#define CMD_SET_ABS 2
#define CMD_SET_FADE 3
#define CMD_SET_BLINK 4

typedef struct
{
	union
	{
		struct
		{
			unsigned char cmd; //Command index
			unsigned char id; //The receiver
			union
			{
				unsigned char rgb[3];
				rgb rgb_color;
			};
			unsigned short val; //Extra data
			unsigned char chksum;
		};
		unsigned char packet[8];
	};
} packet;

extern volatile unsigned char haspacket;
extern volatile packet cmd;

void handlebyte(char b);

void transmitbyte(char b);

#endif
